from datetime import *

dic = dict()
dic['0'] = 13
dic['1'] = 1
dic['2'] = 2
dic['3'] = 3
dic['4'] = 5
dic['5'] = 4
dic['6'] = 4
dic['7'] = 2
dic['8'] = 2
dic['9'] = 2
a = date(2000, 1, 1)
b = date(2024, 4, 13)
count = 0
while a < b:
    s = str(a).replace('-', '')
    score = 0
    for i in s:
        score += dic[i]
    if score > 50:
        count += 1
    a += timedelta(days=1)
print(count)